Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor parseSignatureFromCommitLine #29054

Merged
merged 2 commits into from
Feb 9, 2024

Conversation

wxiaoguang
Copy link
Contributor

@wxiaoguang wxiaoguang commented Feb 5, 2024

Replace #28849. Thanks to @yp05327 for the looking into the problem.
Fix #28840

The old behavior of newSignatureFromCommitline is not right. The new parseSignatureFromCommitLine:

  1. never fails
  2. only accept one format (if there is any other, it could be easily added)

And add some tests.

@wxiaoguang wxiaoguang added type/bug backport/v1.21 This PR should be backported to Gitea 1.21 labels Feb 5, 2024
@wxiaoguang wxiaoguang added this to the 1.22.0 milestone Feb 5, 2024
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 5, 2024
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 5, 2024
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 5, 2024
modules/git/signature_test.go Show resolved Hide resolved
modules/git/signature.go Show resolved Hide resolved
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Feb 9, 2024
@yp05327
Copy link
Contributor

yp05327 commented Feb 9, 2024

The output format is based on the git command, so we can control it.
And we can add other formats easily if we need.

@wxiaoguang
Copy link
Contributor Author

The output format is based on the git command, so we can control it. And we can add other formats easily if we need.

Let's only put this change in 1.22. For the backport, I will still add the legacy format support, to avoid any breaking 😄

@wxiaoguang wxiaoguang merged commit a24e1da into go-gitea:main Feb 9, 2024
25 checks passed
@GiteaBot
Copy link
Contributor

GiteaBot commented Feb 9, 2024

I was unable to create a backport for 1.21. @wxiaoguang, please send one manually. 🍵

go run ./contrib/backport 29054
...  // fix git conflicts if any
go run ./contrib/backport --continue

@GiteaBot GiteaBot added the backport/manual No power to the bots! Create your backport yourself! label Feb 9, 2024
@wxiaoguang wxiaoguang deleted the fix-commiter-parser branch February 9, 2024 03:02
@wxiaoguang wxiaoguang added the backport/done All backports for this PR have been created label Feb 9, 2024
wxiaoguang added a commit to wxiaoguang/gitea that referenced this pull request Feb 9, 2024
Replace go-gitea#28849. Thanks to @yp05327 for the looking into the problem.
Fix go-gitea#28840

The old behavior of newSignatureFromCommitline is not right. The new
parseSignatureFromCommitLine:

1. never fails
2. only accept one format (if there is any other, it could be easily added)

And add some tests.
KN4CK3R pushed a commit that referenced this pull request Feb 9, 2024
Backport #29054. Fix #28840

This backport is for 1.21 only and it is different from the change in
1.22: this backport still accept the legacy date format to avoid
breaking.
silverwind pushed a commit to silverwind/gitea that referenced this pull request Feb 20, 2024
Replace go-gitea#28849. Thanks to @yp05327 for the looking into the problem.
Fix go-gitea#28840

The old behavior of newSignatureFromCommitline is not right. The new
parseSignatureFromCommitLine:

1. never fails
2. only accept one format (if there is any other, it could be easily added)

And add some tests.
6543 pushed a commit to 6543-forks/gitea that referenced this pull request Feb 26, 2024
Replace go-gitea#28849. Thanks to @yp05327 for the looking into the problem.
Fix go-gitea#28840

The old behavior of newSignatureFromCommitline is not right. The new
parseSignatureFromCommitLine:

1. never fails
2. only accept one format (if there is any other, it could be easily added)

And add some tests.

(cherry picked from commit a24e1da)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created backport/manual No power to the bots! Create your backport yourself! backport/v1.21 This PR should be backported to Gitea 1.21 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

slice bounds out of range in function: /modules/git.newSignatureFromCommitline
4 participants